package com.jsbj.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;

@Getter
@AllArgsConstructor
public enum ScenePushTypeEnum {
    USER_POSITION("RYDW","USER_POSITION", "人员定位", "todo/rydw.png"),
    USER_LEAVE("RYQJ","USER_LEAVE", "人员请假", "todo/ryqj.png"),
    SPECIAL_GLSB_LOG("YJTS","SPECIAL_GLSB_LOG", "挂篮设备预警", "todo/yjts.png"),
    SPECIAL_HCD_LOG("YJTS","SPECIAL_HCD_LOG", "航车吊预警", "todo/yjts.png"),
    SPECIAL_JQJ_LOG("YJTS","SPECIAL_JQJ_LOG", "架桥机预警", "todo/yjts.png"),
    SPECIAL_LDD_LOG("YJTS","SPECIAL_LDD_LOG", "履带吊预警", "todo/yjts.png"),
    SPECIAL_LMD_LOG("YJTS","SPECIAL_LMD_LOG", "龙门吊预警", "todo/yjts.png"),
    SPECIAL_QCD_LOG("YJTS","SPECIAL_QCD_LOG", "汽车吊预警", "todo/yjts.png"),
    SNAP_APPROVE("AQZP","SNAP_APPROVE", "安全抓拍", "todo/aqzp.png"),
    BIG_CHECK1("AQDJC","BIG_CHECK1", "安全大检查", "todo/aqdjc.png"),
    BIG_CHECK2("ZXJC","BIG_CHECK2", "专项检查", "todo/zxjc.png"),
    BIG_CHECK3("ZHJC","BIG_CHECK3", "综合检查", "todo/zhjc.png"),
    BIG_CHECK4("JJJC","BIG_CHECK4", "季节检查", "todo/jjjc.png"),
    BIG_CHECK5("ZDHDJC","BIG_CHECK5", "重大活动及节假日检查", "todo/zdhdjjjrjc.png"),
    BIG_CHECK6("SGLBJC","BIG_CHECK6", "事故类比检查", "todo/sglbjc.png"),
    BIG_CHECK7("FGQJC","BIG_CHECK7", "复工前检查", "todo/fgqjc.png"),
    PATROL_CHECK("RCXC","PATROL_CHECK", "日常巡查", "todo/aqxc.png"),
    SPECIAL_TD_LOG("YJTS","SPECIAL_TD_LOG", "塔吊预警-推送", "todo/yjts.png"),
    EQU_CHECK("SBSP","EQU_CHECK", "设备审批", "todo/sbjc.png"),
    LABOR_APPROVE("LWGLSP","LABOR_APPROVE", "劳务管理审批", "todo/gzdsh.png"),
    USER_LEAVE_BH("TZTS","USER_LEAVE_BH", "人员请假驳回", "todo/xxts.png"),
    GZD_BH("TZTS","GZD_BH", "工资单驳回", "todo/xxts.png"),
    EQU_CHECK_BH("TZTS","EQU_CHECK_BH", "设备检查驳回", "todo/xxts.png"),
    BIG_CHECK_NOTIS1("TZTS","BIG_CHECK_NOTIS1", "安全大检查通知", "todo/xxts.png"),
    BIG_CHECK_NOTIS2("TZTS","BIG_CHECK_NOTIS2", "专项检查通知", "todo/xxts.png"),
    BIG_CHECK_NOTIS3("TZTS","BIG_CHECK_NOTIS3", "综合检查通知", "todo/xxts.png"),
    BIG_CHECK_NOTIS4("TZTS","BIG_CHECK_NOTIS4", "季节检查通知", "todo/xxts.png"),
    BIG_CHECK_NOTIS5("TZTS","BIG_CHECK_NOTIS5", "重大活动及节假日检查通知", "todo/xxts.png"),
    BIG_CHECK_NOTIS6("TZTS","BIG_CHECK_NOTIS6", "事故类比检查通知", "todo/xxts.png"),
    BIG_CHECK_NOTIS7("TZTS","BIG_CHECK_NOTIS7", "复工前检查通知", "todo/xxts.png"),
    EXAMINATION_NOTIS("TZTS","EXAMINATION_NOTIS", "安全考试通知", "todo/xxts.png"),
    PENALTY_APPROVE("RCXC_FKSP","PENALTY_APPROVE", "罚款与审批", "todo/fkysp.png");

    private String menuCode;
    private String pushType;
    private String moduleDesc;
    private String modulePath;


    /**
     * 根据菜单编码获取推送类型
     * @param menuCode 值
     * @return 名称集合
     */
    public static List<String> getPushTypeByMenuCode(String menuCode)
    {
        List<String> pushTypeList = new ArrayList<>();
        if (menuCode == null)
        {
            return null;
        }

        for (ScenePushTypeEnum e : ScenePushTypeEnum.toEnumSet())
        {
            if (e.getMenuCode().equals(menuCode))
            {
                String that = e.getPushType();
                pushTypeList.add(that);
            }
        }
        return pushTypeList;
    }

    /**
     * 根据推送类型获取菜单编码
     * @param pushType 值
     * @return 名称集合
     */
    public static String getMenuCodeByPushType(String pushType)
    {
        String menuCode = "";

        for (ScenePushTypeEnum e : ScenePushTypeEnum.toEnumSet())
        {
            if (e.getPushType().equals(pushType))
            {
                menuCode = e.getMenuCode();
            }
        }
        return menuCode;
    }

    public static EnumSet<ScenePushTypeEnum> toEnumSet()
    {
        return EnumSet.allOf(ScenePushTypeEnum.class);
    }


}
